import pygame


# 准星类
class Crosshair():
    def __init__(self, image: pygame.image):
        self.image = image  # 准星图片
        self.rect = self.image.get_rect()  # 准星的rect
        pygame.mouse.set_visible(False)  # 隐藏鼠标

    def draw(self, screen: pygame.Surface):
        self.rect.center = pygame.mouse.get_pos()  # 获取鼠标的位置作为准星的中心位置
        screen.blit(self.image, self.rect)
